<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        window.addEventListener('beforeunload', function() {
            if (confirm("Are u are to leave?")) {
                alert('bYE!');
                return true;
            }
        })
        document.addEventListener('DOMContentLoaded',function(){
            console.log('3 seconds passed');
        });
        function handleClick() {
            window.open('https://baidu.com/');
        }
    </script>
    <script src="./b.js" defer></script>
    <script src="./z.js"></script>
    <script src="./a.js" defer></script>
    
</head>
<body>
    <div>
        script tags
    </div>
    <div>
        <button onclick="handleClick()">Click</button>
    </div>
</body>
</html>